﻿#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QTcpServer>
#include <QTcpSocket>
#include "CJsonObject.hpp"
#include "cJSON.h"
#include <iostream>
#include "findword.h"

using namespace std;
using namespace neb;

namespace Ui {
class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

private slots:
    void on_pushButton_login_clicked();

    void on_pushButton_register_clicked();

    void on_pushButton_connect_clicked();

    void on_pushButton_disconnect_clicked();

    void dealRead();
    void deal_findword(QString word);
    void deal_History();
    void deal_addWord(QString word);
    void deal_reciteword();
    void deal_CheckWord(QString word,QString exp);
signals:
    void find_Result(QString num);
    void add_word(QString num);
   void history_Result(QString history);
   void reciteWord_Result(QString reciteWord);
   void checkWord_Result(QString checkWord);
private:
    Ui::MainWindow *ui;
    QTcpSocket *TcpSocket;    //实例化一个对象。
    QString username;         //定义 QString类型的 用户名和密码
    QString password;
    findWord *fd;
};

#endif // MAINWINDOW_H
